﻿<phone:PhoneApplicationPage 
    x:Class="FinApp.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:list="clr-namespace:FinApp.Controls.Lists"
    xmlns:bars="clr-namespace:FinApp.Controls.Bars"
    xmlns:tiles="clr-namespace:FinApp.Controls.Tiles"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
    shell:SystemTray.BackgroundColor="#1c98d1">

    <!--LayoutRoot es la cuadrícula raíz donde se coloca todo el contenido de la página-->
    <Grid x:Name="LayoutRoot" Background="#1c98d1">
        <!--Control Pivot-->
        <controls:Pivot Title="Fin Apps Party">
            <!--Elemento Pivot uno-->
            <controls:PivotItem Header="Comercios">
                <Grid>
                    <ScrollViewer>
                        <list:ListBoxWithCheckBoxes x:Name="MainListBox" Margin="0,0,0,0" ItemsSource="{Binding CommerceItems}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Margin="0,0,0,17" Orientation="Horizontal">
                                        <!--<tiles:TileSlider TextSlidesFrom="Top" Foreground="#1c98d1" Title="{Binding CommerceName}" Text="{Binding CommerceAddres}" TileBackground="Gray" Size="85" ImageSource="/Yayego.Mobile.App;component/Resources/appbar.location.round.png" />-->
                                        <StackPanel>
                                            <TextBlock Text="{Binding CommerceName}" Foreground="White" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                                            <TextBlock Text="{Binding CommerceAddres}" Foreground="Gray" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                        </StackPanel>
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </list:ListBoxWithCheckBoxes>
                    </ScrollViewer>
                    <bars:ActionBar x:Name="AppBar" BarOpacity="0.4" Background="White">
                        <bars:ActionBarIconButton Command="{Binding NewPaymentCommand}" IconUri="Resources/appbar.qr.png" Text="Pagar" />
                        <bars:ActionBarIconButton Command="{Binding RouteCommand}" IconUri="Resources/appbar.location.round.png" Text="Ruta" />
                    </bars:ActionBar>
                </Grid>
            </controls:PivotItem>

            <!--Elemento Pivot dos-->
            <controls:PivotItem Header="Mapa">
                <Grid>
                    <Grid.Resources>
                        <DataTemplate x:Name="PushpinItemTemplate">
                            <my:Pushpin Location="{Binding CommerceGeoCoordinate}" />
                            <!--Style="{StaticResource PushpinStyle}"-->
                        </DataTemplate>
                    </Grid.Resources>
                    <my:Map Name="promotionsMap" ZoomLevel="18" ZoomBarVisibility="Visible" Center="{Binding CurrentPosition}">
                        <my:MapItemsControl ItemsSource="{Binding CommerceItems}" ItemTemplate="{StaticResource PushpinItemTemplate}" />
                    </my:Map>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Código de ejemplo que muestra el uso de ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Botón 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Botón 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="Elemento de menú 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="Elemento de menú 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>